float4x4 WorldViewProjection;
float4x4 World;

float4 Booleans01;
// Structs
struct VS_INPUT
{
    float4 position				: POSITION;
	float3 normal				: NORMAL;
	float2 textureCoords		: TEXCOORD0;
	float3 tangent				: TANGENT;
};

struct VS_OUTPUT
{
    float4 position				: POSITION;
	float2 textureCoords		: TEXCOORD0;
	float3 positionW			: TEXCOORD1;
	float3 normalW				: TEXCOORD2;
	float3 tangentW				: TEXCOORD3;
	float3 binormalW			: TEXCOORD4;
};

// Shaders
VS_OUTPUT main(VS_INPUT In)
{
    VS_OUTPUT Out = (VS_OUTPUT)0;

	float3 binormal = cross(In.normal, In.tangent);
	if(Booleans01.w >0.5f)
		binormal = -binormal;

    Out.position = mul(In.position, WorldViewProjection);
	Out.textureCoords = In.textureCoords;
	Out.positionW = mul(In.position, World).xyz;
	Out.normalW = mul(In.normal, (float3x3)World);
	Out.tangentW = mul(In.tangent, (float3x3)World);
	Out.binormalW = mul(binormal, (float3x3)World);

    return Out;
}
